package com.honghu.cloud.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import com.honghu.cloud.interceptor.LoginPcInterceptor;
import com.honghu.cloud.interceptor.LoginWxInterceptor;

@Configuration
public class WebConfig implements WebMvcConfigurer {

    /**
     * 添加spring中的拦截器
     */
    @Override
    public void addInterceptors(InterceptorRegistry registry){
    	registry.addInterceptor(new LoginWxInterceptor()).addPathPatterns("/**").
    	excludePathPatterns("/**/apiForFeign/**", "/**/apiPc/**");  // 排除feign和pc端调用的url配置  
    	
    	registry.addInterceptor(new LoginPcInterceptor()).
    	addPathPatterns("/**/apiPc/**"); // 拦截pc端服务配置 
    }

}
